<div class="comment">
	<div><strong>网友评论</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>已有 <b>${content.comments}</b> 条评论，&nbsp;&nbsp;<a href="${base}/comment.jspx?contentId=${content.id}" target="_blank">查看评论»</a></span></div>
  [#include "inc_comment_list.html"/] 
  </div>
  [#if content.channel.commentControl==0 || (content.channel.commentControl==1 && user??)]
  
				<form id="commentForm" action="${base}/comment.jspx" method="post">
				<div class="comment_box fix">
					<label>评论内容：</label> 
					<textarea name="text" id="comment" cols="100%" rows="10" tabindex="4"></textarea>
				</div>

				<div class="comment_box fix">
					<label>验&nbsp;&nbsp;证&nbsp;&nbsp;码：</label> 
					<input type="captcha" id="captcha" vld="{required:true}"  class="ycode"/> 
					<img src="${base}/captcha.svl" onclick="this.src='${base}/captcha.svl?d='+new Date()" src="img/yzm.gif"/>
				</div>
				
				<div class="comment_box2"><input type="submit" value="发表评论" class="submit" id="cmt_post_btn"/></div>
				</form>

<script type="text/javascript">
$(function() {
/*
	$("#commentForm").validate( {
		submitHandler : function(form) {
			$(form).ajaxSubmit( {
				"success" : function(data) {
					if(data.success) {
						alert("评论成功");
						location.href=location.href;
					} else {
						alert("评论失败");
					}
				},
				"dataType" : "json"
			});
		}
	});
*/
	Cms.comment(function(data) {
		if(data.status==0) {
			alert("评论成功");
			location.href=location.href;
		} else if(data.status==1) {	
			alert("验证码错误");
			$("#commentCaptcha").click();
		} else if(data.status==2) {	
			alert("内容不存在");
			$("#commentCaptcha").click();
		} else if(data.status==3) {	
			alert("评论关闭");
			$("#commentCaptcha").click();
		} else if(data.status==4) {	
			alert("需要登录评论");
			$("#commentCaptcha").click();
		} else if(data.status==100) {	
			alert("内容不存在");
			$("#commentCaptcha").click();
		} else if(data.status==101) {	
			alert("评论不能为空");
			$("#commentCaptcha").click();
		} else {
			alert("评论失败");
			$("#commentCaptcha").click();
		}
	});
});
</script>
  </div>
  [#elseif channel.commentControl==1 && !user??]
	[#--登录评论，且未登录--]
	<div style="width:96%;font-size:14px;color:red;margin:10px;">
	您尚未登录，请登录后发布评论！ 【<a href="${base}/login.jspx?returnUrl=/">马上登录</a>】
	</div>
  [#else]
	[#--不允许评论--]
  [/#if]
</div>



